Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a configurable TTL cache for get_ethBalance to eth.ts #1064

Merged
merged 3 commits into from
Apr 14, 2023

Conversation

AlfredoG87
Copy link
Collaborator

Description:
Adding a configurable TTL cache for get_ethBalance to eth.ts

Related issue(s):

Fixes #1059

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@AlfredoG87 AlfredoG87 force-pushed the 1059-eth-get-balance-cache branch from 1bbe0c9 to ec1302a Compare April 14, 2023 22:18
@AlfredoG87 AlfredoG87 self-assigned this Apr 14, 2023
@AlfredoG87 AlfredoG87 requested a review from Nana-EC April 14, 2023 22:22
@codecov-commenter
Copy link

codecov-commenter commented Apr 14, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.28 🎉

Comparison is base (0fc591b) 74.40% compared to head (3917241) 74.68%.

❗ Current head 3917241 differs from pull request most recent head 73b4fc7. Consider uploading reports for the commit 73b4fc7 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1064      +/-   ##
==========================================
+ Coverage   74.40%   74.68%   +0.28%     
==========================================
  Files          31       31              
  Lines        2051     2074      +23     
  Branches      391      395       +4     
==========================================
+ Hits         1526     1549      +23     
  Misses        417      417              
  Partials      108      108              
Impacted Files Coverage Δ
packages/relay/src/lib/errors/JsonRpcError.ts 53.33% <ø> (ø)
packages/relay/src/lib/constants.ts 100.00% <100.00%> (ø)
packages/relay/src/lib/eth.ts 83.78% <100.00%> (+0.45%) ⬆️
packages/relay/src/lib/subscriptionController.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG. Just add a log

packages/relay/src/lib/eth.ts Outdated Show resolved Hide resolved
david-bakin-sl
david-bakin-sl previously approved these changes Apr 14, 2023
Copy link
Member

@david-bakin-sl david-bakin-sl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK!

@AlfredoG87 AlfredoG87 marked this pull request as ready for review April 14, 2023 22:51
@AlfredoG87 AlfredoG87 requested review from a team, ebadiere and lukelee-sl as code owners April 14, 2023 22:51
Signed-off-by: Alfredo Gutierrez <[email protected]>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Nana-EC Nana-EC added this to the 0.22.0 milestone Apr 14, 2023
@Nana-EC Nana-EC added enhancement New feature or request P1 labels Apr 14, 2023
@AlfredoG87 AlfredoG87 merged commit 7eff6c5 into main Apr 14, 2023
@AlfredoG87 AlfredoG87 deleted the 1059-eth-get-balance-cache branch April 14, 2023 23:24
AlfredoG87 added a commit that referenced this pull request Apr 14, 2023
* Adding a configurable TTL cache for get_ethBalance to eth.ts

Signed-off-by: Alfredo Gutierrez <[email protected]>

* Added logs for cache

Signed-off-by: Alfredo Gutierrez <[email protected]>

* Added logs for cache for blockNumber aswell

Signed-off-by: Alfredo Gutierrez <[email protected]>

---------

Signed-off-by: Alfredo Gutierrez <[email protected]>
@AlfredoG87 AlfredoG87 mentioned this pull request Apr 14, 2023
2 tasks
AlfredoG87 added a commit that referenced this pull request Apr 15, 2023
* Adding a configurable TTL cache for get_ethBalance to eth.ts

Signed-off-by: Alfredo Gutierrez <[email protected]>

* Added logs for cache

Signed-off-by: Alfredo Gutierrez <[email protected]>

* Added logs for cache for blockNumber aswell

Signed-off-by: Alfredo Gutierrez <[email protected]>

---------

Signed-off-by: Alfredo Gutierrez <[email protected]>
Nana-EC pushed a commit that referenced this pull request Apr 15, 2023
* Adding a configurable TTL cache for get_ethBalance to eth.ts

Signed-off-by: Alfredo Gutierrez <[email protected]>

* Added logs for cache

Signed-off-by: Alfredo Gutierrez <[email protected]>

* Added logs for cache for blockNumber aswell

Signed-off-by: Alfredo Gutierrez <[email protected]>

---------

Signed-off-by: Alfredo Gutierrez <[email protected]>
Nana-EC pushed a commit that referenced this pull request Apr 15, 2023
* Adding a configurable TTL cache for get_ethBalance to eth.ts

Signed-off-by: Alfredo Gutierrez <[email protected]>

* Added logs for cache

Signed-off-by: Alfredo Gutierrez <[email protected]>

* Added logs for cache for blockNumber aswell

Signed-off-by: Alfredo Gutierrez <[email protected]>

---------

Signed-off-by: Alfredo Gutierrez <[email protected]>
lukelee-sl pushed a commit that referenced this pull request Apr 15, 2023
…1076)

* Adding a configurable TTL cache for get_ethBalance to eth.ts



* Added logs for cache



* Added logs for cache for blockNumber aswell



---------

Signed-off-by: Alfredo Gutierrez <[email protected]>
Co-authored-by: Alfredo Gutierrez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cache support to eth_getBalance
4 participants